package com.iwuke.dance.util;

import android.os.Build;
import android.util.Log;

import com.orhanobut.logger.BuildConfig;

/**
 * @author: 魏从响
 * @date: 2025/9/12
 */
public class LogUtil {
    private static boolean flag=true;

    public static void logD(String key, String value){
        Log.i("++++++++++"+key,value);
//        log("++++++++++"+key,value);
    }
    public static void logD2(String key, String value){
        if (flag){
            if(value.length() > 4000) {
                for(int i=0;i<value.length();i+=4000){
                    if(i+4000<value.length())
                        log(key,value.substring(i, i+4000));
                    else
                        log(key,value.substring(i, value.length()));
                }
            } else
                log("++++++++++"+key,value);
        }
    }

    private static void log(String key, String value){
        if (BuildConfig.DEBUG) {
            if (Build.VERSION.SDK_INT >= 34) {
                Log.i(key,value);
            } else {
                Log.d(key,value);
            }
        }
    }
}
